package com.xxx.pool;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/30 16:56
 * @Copyright 博为峰
 */
public class ThreadPoolExecutorDemo {
    static ThreadLocal<String> local = new ThreadLocal<String>();
    public static void main(String[] args) {
//        final ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 15, 1000, TimeUnit.MINUTES, new ArrayBlockingQueue(5));
//        for (int i = 0; i < 30; i++) {
//            int finalI = i;
//            executor.execute(() -> System.out.println(Thread.currentThread().getName() + "," + finalI));
//
//        }

        local.set("abc");
        System.out.println("local = " + local);
        local.get();
    }
}
